<?php
require_once __DIR__.'/PHPMailer-5.2-stable/PHPMailerAutoload.php';
$name=$_POST['name'];
$title=$_POST['title'];
$content=$_POST['content'];
$mail = new \PHPMailer();
$mail->SMTPDebug = 2;   //输出调试信息   0不输出
$mail->isSMTP(); //设置mailer使用SMTP协议
$mail->Host = "smtp.qq.com"; //设置接受邮件的SMTP服务器地址
$mail->SMTPAuth = true; //开启SMTP认证
$mail->Username = "1119018969@qq.com";   // SMTP的用户名
$mail->Password = "laegytmjfrvujige";   //QQ邮箱的SMTP授权码
$mail->SMTPSecure = "ssl";    //设置开启ssl认证
$mail->Port = "465"; //端口号465或者587
$mail->CharSet='UTF-8';
$mail->setFrom('1119018969@qq.com','小陈');//设置发件人

// 增加一个接受者邮箱
//$mail->addAddress('1119018969@qq.com');
$mail->addAddress($name);

$mail->addAttachment(__DIR__.'/static/img/1.jpg');//添加附件

//设置电子邮件格式为HTML
$mail->isHTML(true);

// 添加该邮件的主题
//$mail->Subject = "Here is the test PHPmailer";
$mail->Subject = "$title";

// 添加邮件正文
//$mail->Body = "你好？验证码123456<span style='color:red'>哈哈</span>";
$mail->Body = "$content";
//发送邮件返回状态
$f=$mail->send();


$mail->ErrorInfo;
